// 引入unocss css
import '@/plugins/unocss'

// 引入svg图标相关
import '@/plugins/svgIcon'

// 初始化多语言
import { setupI18n } from '@/plugins/vueI18n'

// 引入状态管理
import { setupStore } from '@/store'

// 全局组件
import { setupGlobComponent } from '@/components'

// 引入 element-plus
import { setupElementPlus } from '@/plugins/elementPlus'

// 引入 form-create
import { setupFormCreate } from '@/plugins/formCreate'

// 引入vue动画库
import { setupVueMotion } from '@/plugins/vueMotion'

// 引入右键菜单插件
import { setupContextmenu } from '@/plugins/contextmenu'

// 引入抽奖插件
import { setupVueLuckyCanvas } from '@/plugins/vueLuckyCanvas'

// 引入打印插件
import { setupVuePrint } from '@/plugins/vuePrint'

// 引入全局样式
import '@/style/index.scss'

// 引入动画
import '@/plugins/animate.css'

// 引入路由
import router, { setupRouter } from './router'

// 权限
import { setupAuth } from '@/directives'

import { createApp } from 'vue'

import App from '@/App.vue'

// 引入日志插件
import Logger from '@/utils/Logger'

import 'bpmn-js/dist/assets/diagram-js.css' // 基础样式
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn.css' // 节点基础图标
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css' // 节点完整图标
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css'
import '@bpmn-io/properties-panel/dist/assets/properties-panel.css' // 系统属性面板样式

// 小地图
import 'diagram-js-minimap/assets/diagram-js-minimap.css'
// 流程模拟
import 'bpmn-js-token-simulation/assets/css/bpmn-js-token-simulation.css'
// 流程校验
import 'bpmn-js-bpmnlint/dist/assets/css/bpmn-js-bpmnlint.css'

import '@/style/properties-panel.scss'

const setupAll = async () => {
  const app = createApp(App)

  await setupI18n(app)

  setupStore(app)

  setupGlobComponent(app)

  setupElementPlus(app)

  setupFormCreate(app)

  setupVueMotion(app)

  setupContextmenu(app)

  setupVueLuckyCanvas(app)

  setupVuePrint(app)

  setupRouter(app)

  setupAuth(app)

  await router.isReady()

  app.mount('#app')
}

setupAll()

Logger.primary('欢迎使用', '中后台管理系统')
